//
//  CommentCell.m
//  口袋
//
//  Created by dllo on 15/5/27.
//  Copyright (c) 2015年 口袋. All rights reserved.
//

#import "CommentCell.h"
#import "DKNightVersion.h"
#define WIDTH [UIScreen mainScreen].bounds.size.width
#define HEIGHT [UIScreen mainScreen].bounds.size.height
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

@implementation CommentCell
- (void)dealloc
{
    [_headIcon release];
    [_nameLabel release];
    [_phoneLabel release];
    [_noteLabel release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
        [DKNightVersionManager addClassToSet:self.class];
        self.nightBackgroundColor = UIColorFromRGB(0x343434);
    }
    return self;
}
- (void)createCell
{
    self.headIcon = [[UIImageView alloc]initWithFrame:CGRectMake(0.027 * WIDTH, 0.027 *WIDTH, 0.11 * WIDTH, 0.11*WIDTH)];
//    [self.headIcon setBackgroundColor:[UIColor orangeColor]];
    [self addSubview:self.headIcon];
    [self.headIcon release];
    
    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0.038 * WIDTH + self.headIcon.frame.size.width , 0.027 * WIDTH, 0.9 * WIDTH, 0.053 * WIDTH)];
   // [self.nameLabel setBackgroundColor:[UIColor lightGrayColor]];
    self.nameLabel.textColor = [UIColor blueColor];
    self.nameLabel.font = [UIFont systemFontOfSize:14];
    self.nameLabel.nightTextColor = [UIColor lightGrayColor];
    [self addSubview:self.nameLabel];
    [self.nameLabel release];
    
    self.phoneLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.nameLabel.frame.origin.x, 0.027 * WIDTH + self.nameLabel.frame.size.height, 0.9 *WIDTH, 0.053 * WIDTH)];
    //[self.phoneLabel setBackgroundColor:[UIColor orangeColor]];
    self.phoneLabel.textColor = [UIColor grayColor];
    self.phoneLabel.font = [UIFont systemFontOfSize:12];
//    self.phoneLabel.nightTextColor = [UIColor lightGrayColor];
    [self addSubview:self.phoneLabel];
    [self.phoneLabel release];
    
    self.noteLabel = [[UILabel alloc]init];
                     // WithFrame:CGRectMake(self.phoneLabel.frame.origin.x, 0.16 * WIDTH, 250, 100)];
   // [self.noteLabel setBackgroundColor:[UIColor lightGrayColor]];
    self.noteLabel.nightTextColor = [UIColor lightGrayColor];
    [self addSubview:self.noteLabel];
    [self.noteLabel release];
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
